<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>最大最小值</title>
</head>
<body>
<script>
    var arr = [100,200,12,34,5,1,1000];
    var max = 0;
    var min = 2;
    for (var i = 0;i<arr.length;i++){
        if (arr[i]>max){
            max=arr[i]
        }
        if (arr[i]<min){
            min=arr[i]
        }
    }
    document.write(arr);
    document.write("<br>");
    document.write("最大值为:"+max);
    document.write("<br>");
    document.write("最小值为:"+min);



</script>
</body>
</html>